<?php

namespace Service\FakeData;

/**
 * 模拟model获取投票记录数据（demo使用）
 * @author Administrator
 *
 */
class Votelist{
    
    public function run(){

        $data = array();
        
        $ips = array (
            0 => '110.90.35.167',
            1 => '58.20.27.227',
            2 => '14.148.56.64',
            3 => '220.181.51.61',
            4 => '101.104.86.27',
            5 => '60.221.146.32',
            6 => '116.192.21.109',
            7 => '106.6.75.243',
            8 => '124.72.169.248',
            9 => '180.112.48.211',
            10 => '106.38.214.24',
            11 => '106.39.189.170',
            12 => '101.38.34.75',
            13 => '180.232.100.106',
            14 => '39.189.72.29',
            15 => '113.12.120.214',
            16 => '61.135.169.56',
            17 => '114.223.59.108',
            18 => '43.224.214.44',
            19 => '122.247.87.147',
            20 => '111.222.212.71',
            21 => '121.15.138.161',
            22 => '114.117.82.104',
            23 => '182.130.122.198',
            24 => '180.117.8.111',
            25 => '116.249.32.17',
            26 => '115.206.27.232',
            27 => '49.80.164.61',
            28 => '61.131.4.5',
            29 => '183.17.121.144',
            30 => '118.239.3.60',
            31 => '222.215.131.118',
            32 => '115.175.209.127',
            33 => '106.38.216.10',
            34 => '1.12.152.159',
            35 => '42.196.82.29',
            36 => '119.163.145.22',
            37 => '14.205.97.12',
            38 => '183.206.177.200',
            39 => '121.205.36.120',
            40 => '101.199.115.244',
            41 => '153.3.18.75',
            42 => '223.94.129.204',
            43 => '14.153.37.90',
            44 => '101.199.115.36',
            45 => '58.50.131.202',
            46 => '1.199.63.235',
            47 => '110.17.170.54',
            48 => '119.123.112.53',
            49 => '121.207.75.246',
            50 => '121.9.118.195',
            51 => '220.181.51.37',
            52 => '219.135.171.228',
            53 => '124.203.139.153',
            54 => '220.113.137.122',
            55 => '101.199.115.37',
            56 => '119.162.78.147',
            57 => '124.117.138.212',
            58 => '123.103.8.48',
            59 => '183.141.144.138',
            60 => '221.233.178.198',
            61 => '219.133.90.33',
            62 => '59.52.1.47',
            63 => '101.199.115.49',
            64 => '218.20.39.202',
            65 => '101.199.108.43',
            66 => '223.96.150.27',
            67 => '120.36.10.165',
            68 => '123.152.163.124',
            69 => '120.197.198.21',
            70 => '117.86.10.246',
            71 => '111.225.49.169',
            72 => '115.196.244.226',
            73 => '101.199.115.13',
            74 => '116.192.18.167',
            75 => '59.175.236.122',
            76 => '117.136.79.65',
            77 => '112.103.44.137',
            78 => '119.32.137.131',
            79 => '183.56.79.47',
            80 => '183.5.60.81',
            81 => '115.194.126.227',
            82 => '43.224.215.16',
            83 => '183.95.73.246',
            84 => '101.199.115.217',
            85 => '112.5.248.56',
            86 => '114.234.173.126',
            87 => '113.67.219.38',
            88 => '110.72.148.162',
            89 => '42.198.66.44',
            90 => '1.206.32.82',
            91 => '112.193.173.199',
        );
        
        $ips_count = count($ips);
        
        $startnum = mt_rand(300, 600);
        for($i = 30; $i >= 1; $i--){
            $row = array();
            $row['logid'] = $startnum - $i;
            $row['optionid'] = mt_rand(1, 10);
            $row['optionname'] = $row['optionid']. '号选手';
            $row['create_time'] = 1443166210 - $i;
            $row['ip'] = $ips[intval($_SERVER['REQUEST_TIME'] / mt_rand(1, 100)) % $ips_count];
        
            $data[] = $row;
        }
        
        return $data;
    }
    
}
